﻿using UnityEngine;

/// MonoBehaviourEx
public class MonoBehaviourEx : MonoBehaviour
{
    /// <summary>
    /// 根据名字在子对象中查找组件
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="name"></param>
    /// <returns></returns>
    public T FindComponent<T>(string name, bool reportError = true) where T : Component
    {
        return transform.FindComponent<T>(name, reportError);
    }


}